import config from "@/config"
import http from "@/utils/request"

export default {
	list: {
		url: `${config.API_URL}/goods/list`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	},
	get: {
		url: `${config.API_URL}/goods/get`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	},
	add: {
		url: `${config.API_URL}/goods/add`,
		post: async function(data) {
			return await http.post(this.url, data);
		}
	},
	edit: {
		url: `${config.API_URL}/goods/edit`,
		post: async function(data) {
			return await http.post(this.url, data);
		}
	},
	getSkuChecked: {
		url: `${config.API_URL}/goods/sku/info`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	},
	getPriceChecked: {
		// 获取填写的价格
		url: `${config.API_URL}/goods/price/info`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	},
	editNumDefault: {
		url: `${config.API_URL}/goods/edit/num`,
		post: async function(data) {
			return await http.post(this.url, data);
		}
	},
	priceCode: {
		url: `${config.API_URL}/price/code`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	},
	priceGet: {
		url: `${config.API_URL}/goods/price/get`,
		get: async function(data,  config={}){
			return await http.get(this.url, data,  config);
		}
	}
}